import request from "@/utils/request";

//获取所有菜单信息
export const getAllMenus =
    (menuPageBo) => {
    // debugger
        // return request({
        //     method: 'get',
        //     url: `api/x-menu/select_menu_pages`,
        //     // url: `api/x-menu/select_menu_pages?pageSize=${menuPageBo.pageSize}?pageNum=${menuPageBo.pageNum}`,
        //     params: menuPageBo
        // })
        return request({
            method: 'post',
            url: `api/x-menu/select_menu_pages`,
            // url: `api/x-menu/select_menu_pages?pageSize=${menuPageBo.pageSize}?pageNum=${menuPageBo.pageNum}`,
            data: menuPageBo
        })
    }


 //新增菜单
export const createMenu =
    (data) => {
    // debugger
        return request({
            method: 'post',
            url: `api/x-menu/add_menu`,
            data: data
        })
    }


//修改菜单
export const updateMenu =
    (data) => {
        return request({
            method: 'put',
            url: `api/x-menu/update_menu`,
            data: data
        })
    }

//根据id删除某个菜单
export  const deleteMenu=(menuId=0)=>{
    // debugger
    return request({
        method:'Delete',
        url:`api/x-menu/delete_menu/${menuId}`
    })
}

//根据id查询某个菜单
export  const getByIdMenu=(menuId=0)=>{
    // debugger
    return request({
        method:'GET',
        url:`api/x-menu/get_one_menu/${menuId}`
    })
}

